package com.nl.sort;

import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class ArrayMaxSequenceNum {

	//数组组成的最大数字
	public static <T> void maxNum(Integer[]array){
		List<Integer> list =Arrays.asList(array);
		Collections.sort(list, new Comparator<Integer>() {
			@Override
			public int compare(Integer m, Integer n) {
				return -(m+""+n).compareTo((n+""+m));
			}
		});
		
		for(Integer i :list){
			System.out.print(i);
		}

		System.out.println();
	}
	
	public static void main(String[] args) {
	  maxNum(new Integer[]{10,23,42,22});
	}

}
